<!doctype html>
<html lang="zh-cmn-Hans">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"/>
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <!-- MDUI CSS -->
    <link rel="stylesheet" href="View/css/index.css"/>
    <link rel="stylesheet" href="View/css/style.css"/>
    <title>{$page.title}</title>
  </head>
  <body class="mdui-loaded">
    <div class="mdui-appbar-with- mg-app">


<div id="page-user" class="mdui-container">
   <div class="user mdui-card mdui-card-shadow" style="margin-top:1rem;border-top:1px solid rgba(0,0,0,.12);border-top-left-radius:8px;border-top-right-radius:8px">
    <div class="info">
     <div class="avatar-box" style="margin-top:1rem">
      <img src="{$user.avatar}" class="avatar" />
     </div>
     <div class="profile fold">
      <div class="meta username mdui-text-color-theme-text">
       {$user.nick}
      </div>
      <div class="meta">
       <i class="mdui-icon material-icons mdui-text-color-theme-icon">share</i>
       <div class="">
        邀请链接： {$page.pan_path}/api/v3/share/invite/{$user.hashid}
       </div>
       <br>
       <i class="mdui-icon material-icons mdui-text-color-theme-icon">message</i>
       <div class="">
        商务合作： 广告投放、VIP分销联系客服QQ:480232760
       </div>
      </div>
     </div>
    </div>
    <div class="actions">
     <button class="mdui-btn mdui-color-theme-accent mdui-ripple" onclick="goPay()"><i class="mdui-icon mdui-icon-left material-icons">payment</i> 积分充值</button>
     <div class="follow">
      <button class="followers mdui-btn mdui-text-color-theme-secondary">积分：{$user.score}</button>
      <div class="divider"></div>
      <button class="followees mdui-btn mdui-text-color-theme-secondary">邀请：{$invite}人</button>
      <div class="divider"></div>
      <button class="followees mdui-btn mdui-text-color-theme-secondary">提现：{$tx_money}元</button>
     </div>
     <button class="mdui-btn mdui-color-theme-accent mdui-ripple" onclick="goVip()"><i class="mdui-icon mdui-icon-left material-icons">card_giftcard</i> 购买会员</button>
     
    </div>
   </div>
   <div class="contexts mdui-card">

    <div class="mc-tab mdui-tab" mdui-tab>
     <a href="#rule" class="mdui-ripple">分佣规则</a>
     <a href="#integral" class="mdui-ripple {if !empty($smarty.get.page)}mdui-tab-active{/if}">积分流水</a>
     <a href="#withdrawal" class="mdui-ripple">积分提现</a>
     <a href="#subordinate" class="mdui-ripple">我的下级</a>
     
    </div>
    <div id="integral">
     
     <div class="item-list">
     {if $log}
     {foreach from=$log item=one}
     <a class="mc-list-item" href="javascript:void(0)" style="padding-left: 15px;">
       <div class="title mdui-text-color-theme-text">
        {$one.title}&nbsp;<span class="aui-text-primary">{if $one.money>0}+{/if}{$one.money}</span>
       </div>
       <div class="content mdui-text-color-theme-secondary">
        <div class="snippet">
         {$one.mark}
        </div>
        <div class="meta">
         <div class="update_time" >
          {$one.ctime}
         </div>
         <div class="replys">
          <span class="aui-text-primary">{if $one.money>0}[增加]{else}[减少]{/if}</span>
         </div>
        </div>
       </div>
    </a>
    {/foreach}
    {/if}
    <div class="mc-empty {if $log}mdui-hidden{/if}">
      <div class="title">
       暂无记录
      </div>
     </div>
     <h3><div class="aui-pager" style="margin-left:0rem;margin-right:0rem"></div></h3>
     </div>
     
    </div>
    <div id="subordinate" style="display: none;">
     <div class="mc-list-header">
      <div class="title">
       通过专属邀请链接或者文件分享链接注册都可成为下级
      </div>
     </div>
     <div class="item-list" id="user_list">

      </div>
     
     
    </div>
    <div id="withdrawal" style="display: none;">
     <div class="mc-list-header">
       <div class="title">
       10积分等于1元，支付宝5%手续费，一个工作日内到账
      </div>
     </div>
     
    <div class="mdui-textfield mdui-textfield-floating-label mdui-center" style="margin-left: 1rem;margin-right: 1rem;">
      <label class="mdui-textfield-label">支付宝账号，修改账号联系客服</label>
      <input class="mdui-textfield-input" id="alipay_card" required {if $user.alipay_card}readonly value="{$user.alipay_card}"{/if}/>
      <div class="mdui-textfield-error">支付宝账号不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-center" style="margin-left: 1rem;margin-right: 1rem;">
      <label class="mdui-textfield-label">支付宝真实姓名</label>
      <input class="mdui-textfield-input" id="alipay_name" required {if $user.alipay_name}readonly value="{$user.alipay_name}"{/if}/>
      <div class="mdui-textfield-error">支付宝真实姓名不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-center" style="margin-left: 1rem;margin-right: 1rem;">
      <label class="mdui-textfield-label">提现积分，100积分起提</label>
      <input class="mdui-textfield-input" required onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" id="money"/>
      <div class="mdui-textfield-error">提现积分不能为空</div>
    </div>
    
    <div class="actions mdui-clearfix" style="text-align: right;margin: 2rem;">
     <button type="submit" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn" onclick="cksub()">立即提现</button>
    </div>
      <div class="mc-list-header">
        <div class="title">
          近十次提现记录
        </div>
      </div>
      <div class="item-list">
      {foreach from=$tx_log item=one}
       <a class="mc-list-item" href="javascript:void(0)" style="padding-left: 15px;">
         <div class="title mdui-text-color-theme-text">
          {$one.ctime}&nbsp;&nbsp;<span class="aui-text-primary">{$one.money}元</span>
         </div>
        <div class="content mdui-text-color-theme-secondary">
          <div class="snippet">
           提现至账号{$one.alipay_card}
          </div>
          <div class="meta">
           <div class="update_time" >
            {$one.amount}积分
           </div>
           <div class="replys">
            <span class="aui-text-primary">[{$one.state}]</span>
           </div>
          </div>
         </div>
       </a>  
      {/foreach}
      </div>

    </div>
    <div id="rule" style="display: none;">
     <div class="mc-list-header">
      <div class="title">
       规则版本：V1.1&nbsp;&nbsp;修订日期：2020年8月17日
      </div>
     </div>
    <div class="mdui-typo" style="margin: 2rem">
      <p><b>一、分佣渠道</b></p>
      <p>&nbsp;&nbsp;1.付费下载：用户可在分享文件时设定积分付费下载；</p>
      <p>&nbsp;&nbsp;2.邀请返佣：通过邀请或分享链接注册的用户(不包含直链访问)即成为下级，下级消费积分永久返佣；</p>
      <p>&nbsp;&nbsp;3.打赏分成：用户分享的文件，下载者可自愿打赏礼物；</p>
      <p>&nbsp;&nbsp;4.VIP分成：下级开通VIP，邀请者永久返佣；</p>
      <p></p>
      <p><b>二、分佣比例</b></p>
      <p>&nbsp;&nbsp;1.付费下载：用户获得设定积分的90%，以100积分为例，付费下载后用户将获得90积分；</p>
      <p>&nbsp;&nbsp;2.邀请返佣：下级消费积分后用户获得5%返佣，以100积分为例，用户将获得5积分；</p>
      <p>&nbsp;&nbsp;3.打赏分成：下载者打赏礼物后上传者获得礼物价值的90%积分，以100积分为例，用户将获得90积分；</p>
      <p>&nbsp;&nbsp;4.VIP分成：下级用户购买VIP会员后，邀请者获得20%积分，以10元VIP为例，用户获得20积分；</p>
      <p>&nbsp;&nbsp;以上分佣相互不冲突，可同时获得符合条件的所有返佣，例如付费下载用户同时又是你的下级，100积分将获得95积分；</p>
      <p></p>
      <p><b>三、提现规则</b></p>
      <p>&nbsp;&nbsp;1.收入满100积分提现，10积分等于1元；</p>
      <p>&nbsp;&nbsp;2.目前只支持提现至支付宝账号，请确认您填写的支付宝账号和真实姓名无误（提现时填写）；</p>
      <p>&nbsp;&nbsp;3.提现后一个工作日内到账，节假日顺延；</p>
      <p>&nbsp;&nbsp;4.收益的积分也可直接用于消费；</p>
      <p></p>
    </div>
    </div>
   </div>
  </div>




	</div>

    <!-- MDUI JavaScript -->
    <script src="//lib.baomitu.com/jquery/2.2.4/jquery.min.js"></script>
    <script src="View/js/fun.js"></script>
    <script src="//cdn.bilnn.top/js/aui/jquery.pagination.js"></script>
    <script>
      page = 1;
      getUserList();
      function getUserList(){
        if (page==0) return;
        var back = vpost("?c=user&a=user_list","page="+page);
        var lists = "";
        if (back.code==0){
            for (var i = 0; i < back.list.length; i++) {
              lists = '<a class="mc-list-item" href="javascript:void(0)" style="padding-left: 15px;"><div class="title mdui-text-color-theme-text">昵称：'+back['list'][i]['nick']+'&nbsp;&nbsp;<span class="aui-text-primary">(uid:'+back['list'][i]['id']+')</span></div><div class="content mdui-text-color-theme-secondary"><div class="snippet">通过邀请链接注册</div><div class="meta"><div class="update_time" >'+back['list'][i]['created_at']+'</div><div class="replys"><span class="aui-text-primary">[一级]</span></div></div></div></a>';
              $("#user_list").append(lists);
            }
            page++;
        }else{
          page = 0;
        }
      }

      $(window).scroll(function(){
    
        var scrollh = $(document).height();  
        var scrollTop=Math.max(document.documentElement.scrollTop||document.body.scrollTop);  
        if((scrollTop + $(window).height()+100) >= scrollh){  
           getUserList();
        }  
      });

      function goPay(){
        window.parent.window.location.href = "/buy?tab=2";
      }

      function goVip(){
        window.parent.window.location.href = "/buy?tab=1";
      }

      function cksub() {
        var money = $("#money").val();
        var alipay_card = $("#alipay_card").val();
        var alipay_name = $("#alipay_name").val();
        if (money=='' || money<100){
          mdui.alert('提现金额最小100积分');
          return false;
        }
        if (alipay_card==''){
          mdui.alert('支付宝账号不能为空');
          return false;
        }
        if (alipay_name==''){
          mdui.alert('支付宝姓名不能为空');
          return false;
        }
        var back = vpost("?c=user&a=withdrawal","money="+money+"&alipay_card="+alipay_card+"&alipay_name="+alipay_name);
        if (back.code==0){
          $("#money").val("");
        }
        mdui.alert(back.msg);
      }


      {if $pager}
      $('.aui-pager').pagination({
          totalData:{if $pager.total==0}1{else}{$pager.total}{/if},
          showData:{$pager.limit},
          current:{$pager.now},
          count:4,
          mode:'fixed',
          prevContent: '上页',
          nextContent: '下页',
          callback:function(e){
              var urls = window.location.href;
              if (urls.indexOf("page=")==-1){
                  if (urls.indexOf("?")==-1){
                      urls = urls+"?page="+e.getCurrent();
                  }else{
                      urls = urls+"&page="+e.getCurrent();
                  }
              }else{
                  urls = urls.split("page=");
                  urls = urls[0];
                  urls = urls+"page="+e.getCurrent();
              }
              window.location.href = urls;
          }
      });
      {/if}
    </script>
    <script src="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/mdui/1.0.0/js/mdui.min.js"></script>
  </body>
</html>